#include "dialog.h"
#include "ui_dialog.h"

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);
    connect(ui->btn_cancel,&QPushButton::clicked,this,close());

    connect(ui->btn_save,&QPushButton::clicked,this,&Dialog::getinfo);
}

void Dialog::getinfo()
{
    num = ui->let_num->text().toInt();
    name = ui->let_name->text();
    sex = ui->let_sex->text();
    age = ui->let_age->text().toInt();
    this->close();
}

Dialog::~Dialog()
{
    delete ui;
}
